package com.gy.hsim.bservice.asyncload;

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * 
 * @ClassName: ChatRecordFile 
 * @Description: 写聊天记录文件工具类 
 * @author Lee 
 * @date 2015-1-29 下午4:22:39
 */
public class ChatRecordFile {

	
	/**  
     * 追加文件：使用FileOutputStream，在构造FileOutputStream时，把第二个参数设为true  
     *   
     * @param fileName  
     * @param content  
     */   
    public   void  appendFile(String file, String conent) {  
        BufferedWriter out = null ;  
        try  {  
            out = new  BufferedWriter( new  OutputStreamWriter(  
                    new  FileOutputStream(file,  true )));  
            out.write(conent);  
        } catch  (Exception e) {  
            e.printStackTrace();  
        } finally  {  
            try  {  
                out.close();  
            } catch  (IOException e) {  
                e.printStackTrace();  
            }  
        }  
    }  
	
	/** 
	 * @Title: main 
	 * @Description: TODO(这里用一句话描述这个方法的作用) 
	 * @param @param args    设定文件 
	 * @return void    返回类型 
	 * @throws 
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		while (true) {
//			appendFile("D:\\workspace\\hsim\\hsim-bservice\\chatRecordLog\\a.txt","aaaaaa\r\n");
		}
	}

}
